﻿using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MicroStarPrinter
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class SettingsWin : Window
    {
        public SettingsWin()
        {
            InitializeComponent();
             
        }

        private void btnZkusebniTisk_Click(object sender, RoutedEventArgs e)
        {
            Printer.testPrint();
        }

        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            foreach (string printerName in PrinterSettings.InstalledPrinters)
                cboxTiskarna.Items.Add(printerName);

            cboxTiskarna.SelectedItem = Properties.Settings.Default.PrinterName;

        }

        private void cboxTiskarna_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {
            Properties.Settings.Default.PrinterName = cboxTiskarna.SelectedValue.ToString();
            Properties.Settings.Default.Save();
        }

        private void btnOK_Click_1(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
